package com.multi.thread.chapter03.demo12;

import java.io.PipedInputStream;
import java.io.PipedOutputStream;

public class Run {
	
	public static void main(String[] args) throws Exception {
		WriteData writeData = new WriteData();
		ReadData readData = new ReadData();
		
		PipedOutputStream outputStream = new PipedOutputStream();
		PipedInputStream inputStream = new PipedInputStream();
		
		outputStream.connect(inputStream);
		
		ThreadRead threadRead = new ThreadRead(readData, inputStream);
		threadRead.start();
		
		Thread.sleep(2000);
		
		ThreadWrite threadWrite = new ThreadWrite(writeData, outputStream);
		threadWrite.start();
	}

}
